//
//  YHEmotions.swift
//  EmotionKeyboard
//
//  Created by 昱含 on 16/5/31.
//  Copyright © 2016年 YuHan. All rights reserved.
//

import UIKit

class YHEmotions: NSObject {
    
    //分组文件名称
    var id: String?
    
    //在向服务器发送表情的时候传递表情文本
    var chs: String?
    
    //显示在文本输入框中的图片
    var png: String? {
        
        didSet{
            imagePath = NSBundle.mainBundle().bundlePath + "/Emoticons.bundle/" + "\(id ?? "")/" + "\(png ?? "")"
        }
    }
    
    var imagePath: String?
    
    //十六进制的字符串
    var code: String? {
        didSet{
            
            emoji = code?.emojiStr()
        }
    }
    
    var emoji: String?
    
    var isDelete = false
    init(isDelete: Bool) {
        self.isDelete = isDelete
        super.init()
    }
    
    var isEmpty = false
    init(isEmpty: Bool) {
        self.isEmpty = isEmpty
        super.init()
    }
    
    
    init(id: String, dict:[String : AnyObject]) {
        super.init()
        self.id = id
        setValuesForKeysWithDictionary(dict)
    }
    override func setValue(value: AnyObject?, forUndefinedKey key: String) { }
}
